UNAME := $(shell uname)

# Windows
ifeq ($(UNAME), Win32)
COMPILER = gcc
AFLAGS = -Wall
AOUT = bin/Planner.exe
endif

# Linux
ifeq ($(UNAME), Linux)
COMPILER = gcc
AFLAGS = -Wall -lglut -lGL -lGLU -lX11
AOUT = bin/Planner.bin
endif

# Mac OS X
ifeq ($(UNAME), Darwin)
COMPILER = g++
AFLAGS = -Wall -g -framework GLUT -framework OpenGL
AOUT = bin/Planner
endif

all: Planner.cpp Clock.cpp DrawGraphics.cpp Item.cpp Calendar.cpp Events.cpp Text.cpp setTheme.cpp Theme.h Color.h setup/Setup.cpp parser/cardparser.c
	$(COMPILER) $(AFLAGS) Planner.cpp Clock.cpp DrawGraphics.cpp Item.cpp Calendar.cpp Events.cpp Text.cpp setTheme.cpp Theme.h Color.h setup/Setup.cpp parser/cardparser.c -o $(AOUT)
	
clean:
	rm bin/*

run: $(AOUT)
	./$(AOUT)

go: 
	@make
	@make run

caltest: 
	$(COMPILER) -Wall Item.cpp Calendar.cpp parser/cardparser.c test_files/testCalendarClass.cpp -o test_files/TCalClass
	./test_files/TCalClass ./test_files/testcal.ics

it: 
	@echo "\nCaptain, Jean Luc Picard"
so:
	@echo "http://www.youtube.com/watch?v=Tis7imsZyhE\n"

make me a:
	@:
sandwich:
ifeq "$(shell whoami)" "root"
	@echo "Okay"
else
	@echo "What? Make it yourself."
endif

help:	
	@echo ""
	@echo "NAME"
	@echo "  make - build project"
	@echo ""
	@echo "SYNOPSIS"
	@echo "  make [all | run | go | caltest | help]"
	@echo ""
	@echo "DESCRIPTION"
	@echo "  all       - builds everything"
	@echo "  run       - runs pre-built project"
	@echo "  go        - builds again and runs new"
	@echo "  caltest   - builds and runs Calendar class test"
	@echo "  help - ..."
	@echo ""
 
 
